/***	
* date：2018.03.02
* name: 产品详情页-product的,根据产品id获取产品信息的模块
* author：hj
* remarks：null
*/

// 构造器
function getGoodsInfo(_config){
	for(var i in _config){
		this[i]=_config[i];
	}
	this.init();
}
getGoodsInfo.prototype={
	init:function(){
		var _self = this;
		_self.getParam();
	},
	// 获缺url的参数
	getParam:function(){
		var _self = this;
		var _url  = location.href;
		var _num    = _url.indexOf('?')
		var _param    =_url.substring(_num+5)
		_self.getData(_param);
	},
	// 根据参数获取对应的产品数据
	getData:function(_param){
		var _self = this;
 		getAjaxFn(APILIST.goodsIds,{ids:_param},function(_d){
 				_self.goodsTitleId.html(_d.title);
			 	_self.createDom(_d.describe);
 		});
	
	},
	createDom:function(_arrs){
		var _self = this;
		for(var i=0;i<_arrs.length;i++){
			$('<li/>',{})
				.css('font-weight','normal')
				.html(_arrs[i])
				.appendTo(_self.goodsTitleId)
		}

	}

}
new getGoodsInfo({
	goodsTitleId:$('#goodsTitleId'),
	describeId:$('#describeId')
});